<template>
  <div>
    <div class="banner-item" @click="imgShow">
      <img class="banner-img" :src="this.bannerImg" alt="" width="100%" />
      <div class="banner-title">
        {{sightName}}
      </div>
      <div class="banner-num">
        <span class="iconfont">&#xe645;</span>
        {{this.gallaryImgs.length}}
      </div>
    </div>
    <fade-animation>
      <common-gallary :imgs="gallaryImgs" v-show="imgDefault" @close="imgHide"></common-gallary>
    </fade-animation>
  </div>
</template>

<script>
import commonGallary from 'common/gallary/Gallary'
import fadeAnimation from 'common/Fade/FadeAnimation'
export default {
  name: 'detailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array
  },
  data () {
    return {
      imgDefault: false
    }
  },
  methods: {
    imgShow () {
      this.imgDefault = true
    },
    imgHide () {
      this.imgDefault = false
    }
  },
  components: {
    commonGallary,
    fadeAnimation
  }
}
</script>

<style lang="stylus" scoped>
  @import "~styles/varibles.styl"
  .banner-item
    position: relative
    overflow: hidden
    height: 0
    padding-bottom: 55%
    .banner-title
      position: absolute
      bottom: 0
      left: 0
      color: $colorFFF
      line-height: .6rem
      width: 100%
      padding-left: .2rem
      font-size: .32rem
      background-image: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8))
    .banner-num
      box-sizing: border-box
      border-radius: 0.5rem
      position: absolute
      left: .2rem
      width: 1.2rem
      padding-left: .2rem
      line-height: .4rem
      color: $colorFFF
      bottom: .8rem
      background: rgba(0, 0, 0, 0.5)
</style>
